#ifndef T2CDIALOG_H
#define T2CDIALOG_H

#include <QFrame>
#include <QDialogButtonBox>
#include <QGroupBox>
#include <QListView>
#include "T2C/cs_t2cmanager.h"

class QLabel;
class QLineEdit;
class QPushButton;
class QTextEdit;
class QGridLayout;
class QProgressBar;

class T2CDialog : public QFrame
{
    Q_OBJECT

    QLabel * lbl_host;
    QLabel * lbl_port;
    QLabel * lbl_cmd;

    QLineEdit * lnedt_host;
    QLineEdit * lnedt_port;
    QLineEdit * lnedt_cmd;

    QPushButton * btn_connect;
    QPushButton * btn_disconnect;
    QPushButton * btn_exec;
    QPushButton * btnExecPackage;

    QTextEdit * txted_log;

    QLabel      * lbl_i_SZ;
    QLineEdit   * inedt_i_SZ;
    QPushButton * btn_Subscribe;
    QPushButton * btn_Unsubscribe;
    QLabel      * lbl_State;

    QGridLayout * grdLayout;

    /*QHostAddress*/ QString host;
    quint16 port;

    quint64 iSZ;
    bool iSZ_valid;
    void check_iSZ();

    T2CManager * manager;
    
public:
    explicit T2CDialog( QString h, int p, QWidget *parent = 0 );
    virtual ~T2CDialog();
    
private:
    void setEnabledControls( bool connected );


private slots:
    void sltValueReceived( QString val );

public slots:
    void slotConnect();
    void slotDisconnect();
    void slotExec();
    void slotSubscribe();
    void slotUnsubscribe();

private slots:
    void sltReceiveLog( QString txt );
    void sltT2CManChangedConnection();
    void slotExecPackage();

};

#endif // T2CDIALOG_H
